class A{
    @Override
    protected void finalize() throws Throwable{
        System.out.println("对象被回收了！");
    }
}
public class GcTest {
    public static void main(String[] args) {
        for(int i = 0 ; i < 1000000 ; i++){
            A a = new A();
            a = null;

        }
    }
}